package org.clockworkmages.games.anno1186.situations.camp;

import java.util.List;

import org.clockworkmages.games.anno1186.GameBeansContext;
import org.clockworkmages.games.anno1186.GameStateService;
import org.clockworkmages.games.anno1186.Injected;
import org.clockworkmages.games.anno1186.model.character.PlayerCharacter;
import org.clockworkmages.games.anno1186.model.option.GoBackOption;
import org.clockworkmages.games.anno1186.model.option.Option;
import org.clockworkmages.games.anno1186.model.situation.Situation;
import org.clockworkmages.games.anno1186.situations.camp.options.SaveGameOption;
import org.clockworkmages.games.anno1186.util.MathUtil;

public class CampSituation
		extends Situation {

	@Injected
	private GameStateService gameStateService;

	public CampSituation() {
		super();
		GameBeansContext.processInjectAnnotations(this);
	}

	@Override
	public void update() {
		super.update();

		PlayerCharacter playerCharacter = gameStateService.getGameState()
				.getCharacter();

		List<Option> options = getOptions();
		options.clear();

		int experienceNeededToLevelUp = MathUtil
				.experienceNeededToLevelUp(playerCharacter.getLevel());
		// TODO
		// if (playerCharacter.getExperience() > experienceNeededToLevelUp) {
		// options.add(new LevelUpOption());
		// }

		options.add(new SaveGameOption());
		options.add(GoBackOption.INSTANCE);
	}
}
